from flask import Flask
from flask_cors import CORS
from models import db
from views import user_bp


def create_flask_app(config):
    app = Flask(__name__)
    app.config.from_object(config)
    db.init_app(app)
    cors = CORS(app)
    app.register_blueprint(user_bp)
    return app